part of 'component.dart';

class TPTabBar extends StatelessWidget {
  const TPTabBar({
    required this.tabCtrl,
    required this.tabTitles,
    this.selectedColor,
    this.unselectedColor,
  });
  final TabController tabCtrl;
  final List<String> tabTitles;
  final Color? unselectedColor;
  final Color? selectedColor;
  @override
  Widget build(BuildContext context) {
    return BrnTabBar(
      controller: tabCtrl,
      indicatorColor: selectedColor ?? TopColors.main_color,
      backgroundcolor: Colors.transparent,
      labelStyle: TextStyle(
          fontSize: 14.r,
          color: selectedColor ?? TopColors.main_color,
          fontWeight: FontWeight.bold),
      unselectedLabelStyle: TextStyle(
          fontSize: 13.r,
          color: unselectedColor ?? TopColors.black_66,
          fontWeight: FontWeight.w500),
      tabs: tabTitles.map((e) => BadgeTab(text: e)).toList(),
      onTap: (state, index) {
        state.refreshBadgeState(index);
      },
    );
  }
}
